<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MiniWebSvr - 首页</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "Arial", "Microsoft YaHei", sans-serif;
        }
        body {
            background-color: #f5f5f5;
            padding: 50px 20px;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            background-color: white;
            padding: 40px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            color: #2c3e50;
            margin-bottom: 30px;
            border-bottom: 2px solid #3498db;
            padding-bottom: 15px;
        }
        .service-list {
            list-style: none;
            margin-bottom: 40px;
        }
        .service-list li {
            margin: 15px 0;
            padding: 15px;
            background-color: #f8f9fa;
            border-left: 4px solid #3498db;
            border-radius: 4px;
        }
        .service-list a {
            color: #3498db;
            text-decoration: none;
            font-size: 18px;
            font-weight: 500;
        }
        .service-list a:hover {
            color: #2980b9;
            text-decoration: underline;
        }
        .service-desc {
            color: #666;
            margin-top: 8px;
            font-size: 14px;
        }
        .test-section {
            margin-top: 30px;
        }
        h2 {
            color: #2c3e50;
            margin-bottom: 20px;
            font-size: 22px;
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 8px;
            color: #555;
            font-weight: 500;
        }
        input[type="text"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px;
        }
        button {
            background-color: #3498db;
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        button:hover {
            background-color: #2980b9;
        }
        .footer {
            margin-top: 50px;
            text-align: center;
            color: #888;
            font-size: 14px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>MiniWebSvr - 迷你Web服务器</h1>

    <h2>可用服务列表</h2>
    <ul class="service-list">
        <li>
            <a href="/time">访问时间服务 (/time)</a>
            <p class="service-desc">返回当前服务器系统时间，格式：YYYY-MM-DD HH:MM:SS</p>
        </li>
        <li>
            <a href="/echo?name=测试用户&age=20">测试GET参数回显 (/echo)</a>
            <p class="service-desc">通过URL参数传递数据，服务器将回显所有接收的参数（示例已带name和age参数）</p>
        </li>
        <li>
            <a href="#">测试POST参数回显</a>
            <p class="service-desc">通过下方表单提交POST请求，服务器将回显表单中的参数</p>
        </li>
    </ul>

    <div class="test-section">
        <h2>POST参数测试表单</h2>
        <form action="/echo" method="POST">
            <div class="form-group">
                <label for="username">用户名：</label>
                <input type="text" id="username" name="username" placeholder="请输入用户名" required>
            </div>
            <div class="form-group">
                <label for="email">邮箱：</label>
                <input type="text" id="email" name="email" placeholder="请输入邮箱" required>
            </div>
            <div class="form-group">
                <label for="message">留言：</label>
                <input type="text" id="message" name="message" placeholder="请输入留言内容" required>
            </div>
            <button type="submit">提交POST请求</button>
        </form>
    </div>

    <div class="footer">
        <p>© 2025 MiniWebSvr | 基于Java实现的迷你Web服务器</p>
    </div>
</div>
</body>
</html>